package com.hydl.power.controller;


import com.hydl.power.pojo.*;
import com.hydl.power.service.StandingBookService;
import com.hydl.power.utils.IdUtil;
import com.hydl.power.utils.Resp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;
import java.util.UUID;

@Api(value = "StandingBookController", tags = "设备台账")
@RequestMapping("/standingBook")
@RestController
@CrossOrigin
public class StandingBookController {


    @Autowired
    private StandingBookService standingBookService;



    @PostMapping(value = "/getHighVoltageDistributionCabinet")
    @ApiOperation(value = "查询高压柜下面的配电柜(高压柜)",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id", dataType = "String"),
    })
    public Resp getHighVoltageDistributionCabinet(String projectId ,String powerRoomId){
        List<HighVoltageDistributionCabinet> list=standingBookService.getHighVoltageDistributionCabinet(projectId,powerRoomId);
        return Resp.success(list);
    }


    @PostMapping(value = "/getHighVoltageDistributionCabinetDeviceNumber")
    @ApiOperation(value = "查询配电柜的设备数量(高压柜)",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "柜子id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id", dataType = "String"),
    })
    public Resp getHighVoltageDistributionCabinetDeviceNumber(String cabinetId,String projectId ,String powerRoomId){
        List<CabinetDevice> list = standingBookService.getHighVoltageDistributionCabinetDeviceNumber(cabinetId, projectId, powerRoomId);
        return Resp.success(list);
    }


    @PostMapping(value = "/getHighVoltageDistributionCabinetDevice")
    @ApiOperation(value = "查询设备详细信息(高压柜)",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "柜子id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ldentify", value = "1-真空断路器 2-电流互感器 3-微机保护 4-避雷器 ",  dataType = "Integer"),
    })
    public Resp getHighVoltageDistributionCabinetDevice(String cabinetId,Integer ldentify){
        List list = standingBookService.getHighVoltageDistributionCabinetDevice(cabinetId, ldentify);
        return Resp.success(list);
    }



    @PostMapping(value = "/getLowTensionDistributionCabinet")
    @ApiOperation(value = "查询低压柜下面的配电柜(低压柜)",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id", dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id", dataType = "String"),
    })
    public Resp getLowTensionDistributionCabinet(String projectId ,String powerRoomId){
        List<LowTensionDistributionCabinet> list=standingBookService.getLowTensionDistributionCabinet(projectId,powerRoomId);
        return Resp.success(list);
    }


    @PostMapping(value = "/getLowTensionDistributionCabinetDeviceNumber")
    @ApiOperation(value = "查询配电柜的设备数量(低压柜)",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "柜子id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id", dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id", dataType = "String"),
    })
    public Resp getLowTensionDistributionCabinetDeviceNumber(String cabinetId,String projectId ,String powerRoomId){
        List<CabinetDevice> list = standingBookService.getLowTensionDistributionCabinetDeviceNumber(cabinetId, projectId, powerRoomId);
        return Resp.success(list);
    }



    @PostMapping(value = "/getLowTensionDistributionCabinetDevice")
    @ApiOperation(value = "查询设备详细信息(低压柜)",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "柜子id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ldentify", value = "5-万能式断路器 6-电容 7-回路 ",  dataType = "Integer"),
    })
    public Resp getLowTensionDistributionCabinetDevice(String cabinetId,Integer ldentify){
        List list = standingBookService.getLowTensionDistributionCabinetDevice(cabinetId, ldentify);
        return Resp.success(list);
    }


/*    @PostMapping(value = "/getCircuitDevice")
    @ApiOperation(value = "查询回路设备详细信息(低压柜)",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "circuitId", value = "回路id",  dataType = "String"),
    })
    public Resp getCircuitDevice(String circuitId){
        List list = standingBookService.getCircuitDevice(circuitId);
        return Resp.success(list);
    }*/


    @PostMapping(value = "/getDirectCurrentScreenDevice")
    @ApiOperation(value = "查询直流屏",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id", dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id", dataType = "String"),
    })
    public Resp getDirectCurrentScreenDevice(String projectId, String powerRoomId){
        List<DirectCurrentScreen> list = standingBookService.getDirectCurrentScreenDevice(projectId,powerRoomId);
        return Resp.success(list);
    }



    @PostMapping(value = "/getTransformerDevice")
    @ApiOperation(value = "查询变压器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id", dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id", dataType = "String"),
    })
    public Resp getTransformerDevice(String projectId, String powerRoomId){
        List<Transformer> list = standingBookService.getTransformerDevice(projectId,powerRoomId);
        return Resp.success(list);
    }


    @PostMapping(value = "/getDirectCurrentScreenDeviceNumber")
    @ApiOperation(value = "查询直流屏的设备数量",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "directCurrentScreenId", value = "直流屏id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id", dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id", dataType = "String"),
    })
    public Resp getDirectCurrentScreenDeviceNumber(String directCurrentScreenId,String projectId ,String powerRoomId){
        List<CabinetDevice> list = standingBookService.getDirectCurrentScreenDeviceNumber(directCurrentScreenId, projectId, powerRoomId);
        return Resp.success(list);
    }


    @PostMapping(value = "/getChargerModule")
    @ApiOperation(value = "查询直流屏充电模块",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "directCurrentScreenId", value = "直流屏id", dataType = "String"),
    })
    public Resp getChargerModule(String directCurrentScreenId){
        List<ChargerModule> list = standingBookService.getChargerModule(directCurrentScreenId);
        return Resp.success(list);
    }

    @PostMapping(value = "/getBattery")
    @ApiOperation(value = "查询直流屏蓄电池",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "directCurrentScreenId", value = "直流屏id", dataType = "String"),
    })
    public Resp getBattery(String directCurrentScreenId){
        List<Battery> list = standingBookService.getBattery(directCurrentScreenId);
        return Resp.success(list);
    }



    @PostMapping(value = "/addHighVoltageDistributionCabinet")
    @ApiOperation(value = "添加高压柜的配电柜",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp addHighVoltageDistributionCabinet(String name,String projectId,String projectName,String powerRoomId,String powerRoomName){
        standingBookService.addHighVoltageDistributionCabinet(name,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/updateHighVoltageDistributionCabinet")
    @ApiOperation(value = "修改高压柜的配电柜",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp updateHighVoltageDistributionCabinet(String cabinetId,String name,String projectId,String projectName,String powerRoomId,String powerRoomName){
        standingBookService.updateHighVoltageDistributionCabinet(cabinetId,name,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/deleteHighVoltageDistributionCabinet")
    @ApiOperation(value = "删除高压柜的配电柜",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),

    })
    public Resp deleteHighVoltageDistributionCabinet(String cabinetId){
        Integer integer = standingBookService.deleteHighVoltageDistributionCabinet(cabinetId);
        if (integer==1){
            return Resp.success("删除成功");
        }else {
            return Resp.fail("有子设备无法删除");
        }

    }


    @PostMapping(value = "/addVacuumCircuitBreaker")
    @ApiOperation(value = "添加真空断路器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "frequency", value = "频率",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "voltage", value = "电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "electricCurrent", value = "电流",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "controlVoltage", value = "操作电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "energyStorageVoltage", value = "储能电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp addVacuumCircuitBreaker(String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String frequency, String voltage, String electricCurrent, String controlVoltage, String energyStorageVoltage , String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.addVacuumCircuitBreaker(name,manufactor,serialNumber,modelNumber,productionTime,frequency,voltage,electricCurrent,controlVoltage,energyStorageVoltage,cabinetId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/updateVacuumCircuitBreaker")
    @ApiOperation(value = "修改真空断路器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "frequency", value = "频率",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "voltage", value = "电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "electricCurrent", value = "电流",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "controlVoltage", value = "操作电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "energyStorageVoltage", value = "储能电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp updateVacuumCircuitBreaker(Integer id,String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String frequency, String voltage, String electricCurrent, String controlVoltage, String energyStorageVoltage , String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.updateVacuumCircuitBreaker(id,name,manufactor,serialNumber,modelNumber,productionTime,frequency,voltage,electricCurrent,controlVoltage,energyStorageVoltage,cabinetId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/deleteVacuumCircuitBreaker")
    @ApiOperation(value = "删除真空断路器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "String"),
    })
    public Resp deleteVacuumCircuitBreaker(Integer id){
        standingBookService.deleteVacuumCircuitBreaker(id);
        return Resp.success();
    }



    @PostMapping(value = "/addCurrentTransformer")
    @ApiOperation(value = "添加高压柜电流互感器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "transformationRatio", value = "变比",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp addCurrentTransformer(String name, String manufactor, String serialNumber, String modelNumber, String productionTime,String transformationRatio , String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.addCurrentTransformer(name,manufactor,serialNumber,modelNumber,productionTime,transformationRatio,cabinetId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/updateCurrentTransformer")
    @ApiOperation(value = "修改高压柜电流互感器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "transformationRatio", value = "变比",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp updateCurrentTransformer(Integer id,String name, String manufactor, String serialNumber, String modelNumber, String productionTime,String transformationRatio , String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.updateCurrentTransformer(id,name,manufactor,serialNumber,modelNumber,productionTime,transformationRatio,cabinetId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/deleteCurrentTransformer")
    @ApiOperation(value = "删除高压柜电流互感器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
    })
    public Resp deleteCurrentTransformer(Integer id){
        standingBookService.deleteCurrentTransformer(id);
        return Resp.success();
    }



    @PostMapping(value = "/addMicrocomputerProtection")
    @ApiOperation(value = "添加高压柜微机保护",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp addMicrocomputerProtection(String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.addMicrocomputerProtection(name,manufactor,serialNumber,modelNumber,productionTime,cabinetId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/updateMicrocomputerProtection")
    @ApiOperation(value = "修改高压柜微机保护",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp updateMicrocomputerProtection(Integer id,String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.updateMicrocomputerProtection(id,name,manufactor,serialNumber,modelNumber,productionTime,cabinetId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }

    @PostMapping(value = "/deleteMicrocomputerProtection")
    @ApiOperation(value = "删除高压柜微机保护",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
    })
    public Resp deleteMicrocomputerProtection(Integer id){
        standingBookService.deleteMicrocomputerProtection(id);
        return Resp.success();
    }


    @PostMapping(value = "/addArrester")
    @ApiOperation(value = "添加高压柜避雷器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp addArrester(String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.addArrester(name,manufactor,serialNumber,modelNumber,productionTime,cabinetId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/updateArrester")
    @ApiOperation(value = "修改高压柜避雷器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp updateArrester(Integer id, String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.updateArrester(id,name,manufactor,serialNumber,modelNumber,productionTime,cabinetId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/deleteArrester")
    @ApiOperation(value = "删除高压柜避雷器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
    })
    public Resp deleteArrester(Integer id){
        standingBookService.deleteArrester(id);
        return Resp.success();
    }

    @PostMapping(value = "/addLowTensionDistributionCabinet")
    @ApiOperation(value = "添加低压柜的配电柜",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp addLowTensionDistributionCabinet(String name,String projectId,String projectName,String powerRoomId,String powerRoomName){
        standingBookService.addLowTensionDistributionCabinet(name,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }

    @PostMapping(value = "/updateLowTensionDistributionCabinet")
    @ApiOperation(value = "修改低压柜的配电柜",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp updateLowTensionDistributionCabinet(String cabinetId,String name,String projectId,String projectName,String powerRoomId,String powerRoomName){
        standingBookService.updateLowTensionDistributionCabinet(cabinetId,name,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/deleteLowTensionDistributionCabinet")
    @ApiOperation(value = "删除低压柜的配电柜",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
    })
    public Resp deleteLowTensionDistributionCabinet(String cabinetId){
        Integer integer = standingBookService.deleteLowTensionDistributionCabinet(cabinetId);
        if (integer==1){
            return Resp.success("删除成功");
        }else {
            return Resp.fail("有子设备无法删除");
        }
    }




    @PostMapping(value = "/addUniversalCircuitBreaker")
    @ApiOperation(value = "添加低压柜万能式断路器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ue", value = "额定工作电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "lcu", value = "额定运行短路分段能力",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ln", value = "ln",  dataType = "String"),
    })
    public Resp addUniversalCircuitBreaker(String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName,String ue,String lcu,String ln){
        standingBookService.addUniversalCircuitBreaker(name,manufactor,serialNumber,modelNumber,productionTime,cabinetId,projectId,projectName,powerRoomId,powerRoomName,ue,lcu,ln);
        return Resp.success();
    }


    @PostMapping(value = "/updateUniversalCircuitBreaker")
    @ApiOperation(value = "修改低压柜万能式断路器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ue", value = "额定工作电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "lcu", value = "额定运行短路分段能力",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ln", value = "ln",  dataType = "String"),
    })
    public Resp updateUniversalCircuitBreaker(Integer id,String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName,String ue,String lcu,String ln){
        standingBookService.updateUniversalCircuitBreaker(id,name,manufactor,serialNumber,modelNumber,productionTime,cabinetId,projectId,projectName,powerRoomId,powerRoomName,ue,lcu,ln);
        return Resp.success();
    }


    @PostMapping(value = "/deleteUniversalCircuitBreaker")
    @ApiOperation(value = "删除低压柜万能式断路器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
    })
    public Resp deleteUniversalCircuitBreaker(Integer id){
        standingBookService.deleteUniversalCircuitBreaker(id);
        return Resp.success();
    }



    @PostMapping(value = "/addCapacitance")
    @ApiOperation(value = "添加低压柜电容",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ratedCapacity", value = "额定容量",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ratedCapacitance", value = "额定电容",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ratedVoltage", value = "额定电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ratedCurrent", value = "额定电流",  dataType = "String"),
    })
    public Resp addCapacitance(String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName,String ratedCapacity,String ratedCapacitance,String ratedVoltage,String ratedCurrent){
        standingBookService.addCapacitance(name,manufactor,serialNumber,modelNumber,productionTime,cabinetId,projectId,projectName,powerRoomId,powerRoomName,ratedCapacity,ratedCapacitance,ratedVoltage,ratedCurrent);
        return Resp.success();
    }


    @PostMapping(value = "/updateCapacitance")
    @ApiOperation(value = "修改低压柜电容",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ratedCapacity", value = "额定容量",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ratedCapacitance", value = "额定电容",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ratedVoltage", value = "额定电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ratedCurrent", value = "额定电流",  dataType = "String"),
    })
    public Resp updateCapacitance(Integer id,String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName,String ratedCapacity,String ratedCapacitance,String ratedVoltage,String ratedCurrent){
        standingBookService.updateCapacitance(id,name,manufactor,serialNumber,modelNumber,productionTime,cabinetId,projectId,projectName,powerRoomId,powerRoomName,ratedCapacity,ratedCapacitance,ratedVoltage,ratedCurrent);
        return Resp.success();
    }



    @PostMapping(value = "/deleteCapacitance")
    @ApiOperation(value = "删除低压柜电容",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
    })
    public Resp deleteCapacitance(Integer id){
        standingBookService.deleteCapacitance(id);
        return Resp.success();
    }


    @PostMapping(value = "/addCircuit")
    @ApiOperation(value = "添加低压柜回路",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp addCircuit(String name, String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.addCircuit(name,cabinetId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/updateCircuit")
    @ApiOperation(value = "修改低压柜回路",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "配电柜id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp updateCircuit(Integer id, String name, String cabinetId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.updateCircuit(id,name,cabinetId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/deleteCircuit")
    @ApiOperation(value = "删除低压柜回路",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
    })
    public Resp deleteCircuit(Integer id){
        Integer integer = standingBookService.deleteCircuit(id);
        if (integer==1){
            return Resp.success("删除成功");
        }else {
            return Resp.fail("有子设备无法删除");
        }
    }



    @PostMapping(value = "/addLowVoltageTransformer")
    @ApiOperation(value = "添加低压柜电流互感器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "transformationRatio", value = "变比",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "circuitId", value = "回路id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp addLowVoltageTransformer(String name, String manufactor, String serialNumber, String modelNumber, String productionTime,String transformationRatio , String circuitId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.addLowVoltageTransformer(name,manufactor,serialNumber,modelNumber,productionTime,transformationRatio,circuitId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/updateLowVoltageTransformer")
    @ApiOperation(value = "修改低压柜电流互感器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "transformationRatio", value = "变比",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "circuitId", value = "回路id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp updateLowVoltageTransformer(Integer id,String name, String manufactor, String serialNumber, String modelNumber, String productionTime,String transformationRatio , String circuitId , String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.updateLowVoltageTransformer(id,name,manufactor,serialNumber,modelNumber,productionTime,transformationRatio,circuitId,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/deleteLowVoltageTransformer")
    @ApiOperation(value = "删除低压柜电流互感器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
    })
    public Resp deleteLowVoltageTransformer(Integer id){
        standingBookService.deleteLowVoltageTransformer(id);
        return Resp.success();
    }



    @PostMapping(value = "/addLowVoltageCircuitBreaker")
    @ApiOperation(value = "添加回路断路器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "circuitId", value = "回路id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ue", value = "额定工作电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "lcu", value = "额定运行短路分段能力",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ln", value = "ln",  dataType = "String"),
    })
    public Resp addLowVoltageCircuitBreaker(String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String circuitId , String projectId, String projectName, String powerRoomId, String powerRoomName,String ue,String lcu,String ln){
        standingBookService.addLowVoltageCircuitBreaker(name,manufactor,serialNumber,modelNumber,productionTime,circuitId,projectId,projectName,powerRoomId,powerRoomName,ue,lcu,ln);
        return Resp.success();
    }


    @PostMapping(value = "/updateLowVoltageCircuitBreaker")
    @ApiOperation(value = "修改回路断路器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "circuitId", value = "回路id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ue", value = "额定工作电压",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "lcu", value = "额定运行短路分段能力",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "ln", value = "ln",  dataType = "String"),
    })
    public Resp updateLowVoltageCircuitBreaker(Integer id,String name, String manufactor, String serialNumber, String modelNumber, String productionTime, String circuitId , String projectId, String projectName, String powerRoomId, String powerRoomName,String ue,String lcu,String ln){
        standingBookService.updateLowVoltageCircuitBreaker(id,name,manufactor,serialNumber,modelNumber,productionTime,circuitId,projectId,projectName,powerRoomId,powerRoomName,ue,lcu,ln);
        return Resp.success();
    }


    @PostMapping(value = "/deleteLowVoltageCircuitBreaker")
    @ApiOperation(value = "删除回路断路器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
    })
    public Resp deleteLowVoltageCircuitBreaker(Integer id){
        standingBookService.deleteLowVoltageCircuitBreaker(id);
        return Resp.success();
    }



    @PostMapping(value = "/getCircuit")
    @ApiOperation(value = "查询回路",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "cabinetId", value = "柜子id",  dataType = "String"),
    })
    public Resp getCircuit(String cabinetId){
        List<Circuit> list = standingBookService.getCircuit(cabinetId);
        return Resp.success(list);
    }

    @PostMapping(value = "/addDirectCurrentScreen")
    @ApiOperation(value = "添加直流屏",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp addDirectCurrentScreen(String name, String manufactor, String serialNumber, String modelNumber, String productionTime,  String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.addDirectCurrentScreen(name,manufactor,serialNumber,modelNumber,productionTime,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }

    @PostMapping(value = "/updateDirectCurrentScreen")
    @ApiOperation(value = "修改直流屏",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "ID",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
    })
    public Resp updateDirectCurrentScreen(Integer id,String name, String manufactor, String serialNumber, String modelNumber, String productionTime,  String projectId, String projectName, String powerRoomId, String powerRoomName){
        standingBookService.updateDirectCurrentScreen(id,name,manufactor,serialNumber,modelNumber,productionTime,projectId,projectName,powerRoomId,powerRoomName);
        return Resp.success();
    }


    @PostMapping(value = "/deleteDirectCurrentScreen")
    @ApiOperation(value = "删除直流屏",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "ID",  dataType = "Integer"),

    })
    public Resp deleteDirectCurrentScreen(Integer id){
        Integer integer = standingBookService.deleteDirectCurrentScreen(id);
        if (integer==1){
            return Resp.success("删除成功");
        }else {
            return Resp.fail("有子设备无法删除");
        }
    }


    @PostMapping(value = "/addChargerModule")
    @ApiOperation(value = "添加充电模块",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "directCurrentScreenId", value = "直流屏id",  dataType = "String"),
    })
    public Resp addChargerModule(String name, String manufactor, String serialNumber, String modelNumber, String productionTime,  String projectId, String projectName, String powerRoomId, String powerRoomName,String directCurrentScreenId){
        standingBookService.addChargerModule(name,manufactor,serialNumber,modelNumber,productionTime,projectId,projectName,powerRoomId,powerRoomName,directCurrentScreenId);
        return Resp.success();
    }


    @PostMapping(value = "/updateChargerModule")
    @ApiOperation(value = "修改充电模块",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "directCurrentScreenId", value = "直流屏id",  dataType = "String"),
    })
    public Resp updateChargerModule(Integer id,String name, String manufactor, String serialNumber, String modelNumber, String productionTime,  String projectId, String projectName, String powerRoomId, String powerRoomName,String directCurrentScreenId){
        standingBookService.updateChargerModule(id,name,manufactor,serialNumber,modelNumber,productionTime,projectId,projectName,powerRoomId,powerRoomName,directCurrentScreenId);
        return Resp.success();
    }



    @PostMapping(value = "/deleteChargerModule")
    @ApiOperation(value = "删除充电模块",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),

    })
    public Resp deleteChargerModule(Integer id){
        standingBookService.deleteChargerModule(id);
        return Resp.success();
    }



    @PostMapping(value = "/addBattery")
    @ApiOperation(value = "添加蓄电池",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "directCurrentScreenId", value = "直流屏id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceNumber", value = "蓄电池数量",  dataType = "String"),
    })
    public Resp addBattery(String name, String manufactor, String serialNumber, String modelNumber, String productionTime,  String projectId, String projectName, String powerRoomId, String powerRoomName,String directCurrentScreenId,String deviceNumber){
        standingBookService.addBattery(name,manufactor,serialNumber,modelNumber,productionTime,projectId,projectName,powerRoomId,powerRoomName,directCurrentScreenId,deviceNumber);
        return Resp.success();
    }


    @PostMapping(value = "/updateBattery")
    @ApiOperation(value = "修改蓄电池",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "name", value = "名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "serialNumber", value = "序列号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "directCurrentScreenId", value = "直流屏id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceNumber", value = "蓄电池数量",  dataType = "String"),
    })
    public Resp updateBattery(Integer id,String name, String manufactor, String serialNumber, String modelNumber, String productionTime,  String projectId, String projectName, String powerRoomId, String powerRoomName,String directCurrentScreenId,String deviceNumber){
        standingBookService.updateBattery(id,name,manufactor,serialNumber,modelNumber,productionTime,projectId,projectName,powerRoomId,powerRoomName,directCurrentScreenId,deviceNumber);
        return Resp.success();
    }


    @PostMapping(value = "/deleteBattery")
    @ApiOperation(value = "删除蓄电池",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),

    })
    public Resp deleteBattery(Integer id){
        standingBookService.deleteBattery(id);
        return Resp.success();
    }




    @PostMapping(value = "/addTransformer")
    @ApiOperation(value = "添加变压器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "transformerName", value = "变压器名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "transformerCapacity", value = "变压器容量",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cityId", value = "城市id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cityName", value = "城市名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceId", value = "设备id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceName", value = "设备名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "installTime", value = "设备安装时间",  dataType = "String"),
    })
    public Resp addTransformer(String transformerName,String transformerCapacity, String manufactor, String modelNumber, String productionTime,String cityId,String cityName,  String projectId, String projectName, String powerRoomId, String powerRoomName,String deviceId,String deviceName,String installTime){
        standingBookService.addTransformer(transformerName,transformerCapacity,manufactor,modelNumber,productionTime,cityId,cityName,projectId,projectName,powerRoomId,powerRoomName,deviceId,deviceName,installTime);
        return Resp.success();
    }


    @PostMapping(value = "/updateTransformer")
    @ApiOperation(value = "修改变压器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "transformerName", value = "变压器名字",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "transformerCapacity", value = "变压器容量",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "manufactor", value = "厂家",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "modelNumber", value = "型号",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "productionTime", value = "生产日期",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cityId", value = "城市id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "cityName", value = "城市名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "projectName", value = "项目名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "powerRoomName", value = "配电房名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceId", value = "设备id",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceName", value = "设备名",  dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "installTime", value = "设备安装时间",  dataType = "String"),
    })
    public Resp updateTransformer(Integer id,String transformerName,String transformerCapacity, String manufactor, String modelNumber, String productionTime,String cityId,String cityName,  String projectId, String projectName, String powerRoomId, String powerRoomName,String deviceId,String deviceName,String installTime){
        standingBookService.updateTransformer(id,transformerName,transformerCapacity,manufactor,modelNumber,productionTime,cityId,cityName,projectId,projectName,powerRoomId,powerRoomName,deviceId,deviceName,installTime);
        return Resp.success();
    }



    @PostMapping(value = "/deleteTransformer")
    @ApiOperation(value = "删除变压器",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", value = "id",  dataType = "Integer"),
    })
    public Resp deleteTransformer(Integer id){
        standingBookService.deleteTransformer(id);
        return Resp.success();
    }


    @PostMapping(value = "/getDevice")
    @ApiOperation(value = "查询设备",produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "powerRoomId", value = "配电房id",  dataType = "String"),
    })
    public Resp getDevice( String powerRoomId){
        List<Device> list = standingBookService.getDevice(powerRoomId);
        return Resp.success(list);
    }





}
